(bug 16207) - Fix title protection in the API. $expiry is cast to an array near the...
authorAlex Z <mrzman@users.mediawiki.org>
Sat, 1 Nov 2008 00:00:25 +0000 (00:00 +0000)
committerAlex Z <mrzman@users.mediawiki.org>
Sat, 1 Nov 2008 00:00:25 +0000 (00:00 +0000)
includes/api/ApiProtect.php

index f6eb32c..ecd09eb 100644 (file)
@@ -109,7 +109,7 @@ class ApiProtect extends ApiBase {
                        $articleObj = new Article($titleObj);
                        $ok = $articleObj->updateRestrictions($protections, $params['reason'], $params['cascade'], $expiryarray);
                } else
-                       $ok = $titleObj->updateTitleProtection($protections['create'], $params['reason'], $expiry);
+                       $ok = $titleObj->updateTitleProtection($protections['create'], $params['reason'], $expiryarray['create']);
                if(!$ok)
                        // This is very weird. Maybe the article was deleted or the user was blocked/desysopped in the meantime?
                        // Just throw an unknown error in this case, as it's very likely to be a race condition